<?php
namespace Admin\Model;
use Think\Model;
class GoodsModel extends Model{
	public $_validate	=	array(
		array('name','require','名称必须存在'),
		//array('name','','规则标识必须唯一',self::EXISTS_VALIDATE,'unique',self::MODEL_BOTH),
		);

	public $_auto		=	array(
		array('createtime','time',self::MODEL_INSERT,'function'),
		array('edittime','time',self::MODEL_BOTH,'function'),
		array('uid','getId',self::MODEL_BOTH,'callback')
		);

	//这个函数获取session里的ID值
	public function getId(){
		return $_SESSION['uid'];
	}
} 